using Whisper.CommonTypes;
using Whisper.Interfaces;

namespace Whisper.Objects
{
    public class CreateConversationClientController : IConversationClientController
    {
        private readonly IConversationServiceAdapter Adapter;
        private readonly ICreateConversationClientView View;

        public CreateConversationClientController(IConversationServiceAdapter adapter, ICreateConversationClientView view)
        {
            Adapter = adapter;
            View = view;
            View.SubmitConversation += SubmitSubscription;
        }

        void SubmitSubscription(object sender, System.EventArgs e)
        {
            Adapter.CreateConversationRegistration(View.ConversationName);
        }

    }
}